package cn.ryh.hystrix.service;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author Rao
 * @Description
 * @create 2021-12-06 15:35
 */
@Component
public class HystrixClientFactory implements FallbackFactory<PaymentFeignService> {

    @Override
    public PaymentFeignService create(Throwable throwable) {
        return new PaymentFeignService() {
            @Override
            public String getServer() {
                return "全局降级兜底方法测试 HystrixClientFactory";
            }
            @Override
            public String getServerTimeOut() {
                return null;
            }
        };
    }
}
